﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace MShop.Core.Domain
{
    [MetadataType(typeof(Announce_Validation))]
    public partial class Announce
    {
        public Announce()
        {
            this.Created = DateTime.Now;
            this.Status = 1;
            this.Sort = 1;
        }
    }

    internal partial class Announce_Validation
    {
        [DisplayName("公告标题")]
        [Required(ErrorMessage = "公告标题不能为空")]
        public string Title { get; set; }

         
     
        [DataType(DataType.MultilineText)]
        [DisplayName("公告内容")]
        public string Content { get; set; }


        [Required(ErrorMessage = "创建日期不能为空")]
        [DisplayName("创建日期")]
        public DateTime Created { get; set; }


        [Required(ErrorMessage = "排序序号不能为空")]
        [DisplayName("排序序号")]
        [Range(1, 1000000, ErrorMessage = "排序序号只能为整数")]
        public int Sort { get; set; }
        
    }
}